import React, { Component } from 'react';
import { Image, TouchableOpacity, View, ImageBackground, Text } from 'react-native';
import { unitWidth } from '../constants/AdapterUtil';
import { Header } from 'react-native-elements';
import Colors from '../constants/Colors';

export default class BigImageScreen extends Component {

    constructor(props) {
        super(props);
        const { navigation } = this.props;
        this.state = {
            url: navigation.getParam('url', ''),
            title: '',
        }
    }

    render() {
        return (
            <ImageBackground style={{ flex: 1 }} source={{ uri: this.state.url }} resizeMode='cover'>
                <Header
                    containerStyle={{
                        backgroundColor: Colors.transparent,
                        justifyContent: 'space-around',
                        borderBottomColor: Colors.transparent,//去掉下划线
                    }}>
                    <TouchableOpacity onPress={() => { this.props.navigation.pop() }}>
                        <View style={{ alignSelf: 'stretch', height: 20 * unitWidth, justifyContent: 'center' }}>
                            <Image source={require('../res/ic_arrow_left.png')}
                                style={{ width: 25 * unitWidth, height: 25 * unitWidth, marginLeft: 10 }}
                                resizeMode='contain' />
                        </View>
                    </TouchableOpacity>
                    <Text style={{ fontSize: 13 * unitWidth, color: Colors.colorGold }}></Text>
                </Header>
            </ImageBackground>
        );
    }
}